<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: zhang_yao_wu1993
  Date: 15/4/21
  Time: 下午10:33
--%>
<!DOCTYPE html>
<html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<head>
    <title>ZeRur</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script type="text/javascript" src="/Other/Lib/jquery-2.1.3.js"></script>
    <script type="text/javascript" src="/Other/Lib/SemanticUI/dist/semantic.min.js"></script>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/button.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/segment.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/label.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/grid.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/menu.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/dropdown.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/transition.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/divider.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/icon.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/list.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/image.min.css"/>
    <link rel="stylesheet" href="/Other/Lib/SemanticUI/dist/components/header.min.css"/>
    <script type="text/javascript" src="/Other/JavaScript/blog_Main.js"></script>
    <link rel="stylesheet" href="/Other/StyleSheet/blog_Main.css"/>
</head>
<body style="background: RGBA(236, 236, 236, 1)">
<%-- header --%>
<div id="header">
    <sec:authorize access="hasAnyRole('ROLE_ADMIN','ROLE_USER')">
        <div class="ui divided horizontal list">
            <div class="item"><a href="javascript:void(0)">${blogMainPageVo.loginStatusMessage}</a></div>
            <div class="item"><a href="/">欢迎页</a></div>
            <div class="item"><a href="javascript:void(0)" style="color: white;">主页</a></div>
            <div class="item"><a href="/MessagePage">留言</a></div>
            <div class="item"><a href="/IndividualCenter">个人中心</a></div>
            <div class="item"><a href="/ManagePage">管理</a></div>
            <div class="item"><a onclick="logout()">登出</a></div>
            <form action="/j_logout" method="post">
                <input type="hidden"
                       name="${_csrf.parameterName}"
                       value="${_csrf.token}"/>
            </form>
            <script>
                function logout() {
                    $("#header div form").submit();
                }
            </script>
        </div>
    </sec:authorize>
    <sec:authorize access="isAnonymous()">
        <div class="ui divided horizontal list">
            <div class="item"><a href="javascript:void(0)">${blogMainPageVo.loginStatusMessage}</a></div>
            <div class="item"><a href="/">欢迎页</a></div>
            <div class="item"><a href="javascript:void(0)" style="color: white;">主页</a></div>
            <div class="item"><a href="/MessagePage">留言</a></div>
            <div class="item"><a href="/IndividualCenter">个人中心</a></div>
            <div class="item"><a href="/ManagePage">管理</a></div>
            <div class="item"><a href="/LoginPage">登陆</a></div>
            <div class="item"><a href="/RegisterPage">注册</a></div>
        </div>
    </sec:authorize>
</div>
<%-- end header --%>
<%-- body --%>
<div id="body">
    <%-- body_top --%>
    <div id="body_top">
        <a class="ui green label">
            春天的樱花<br/>
            <span>在长长的坂道上飞舞得漫天绚烂</span>
        </a>
        <a class="ui red label">
            夏夜的萤火<br/>
            <span>穿梭在林间传诉着千年的传说</span>
        </a>
        <a class="ui orange label">
            秋季的丹桂<br/>
            <span>在盛开与凋零之间包含着相遇与离别</span>
        </a>
        <a class="ui blue label">
            冬日的落雪<br/>
            <span>是谁拂去了围巾上沉积的旷古冰寒</span>
        </a>
    </div>
    <%-- end body_top --%>
    <%-- body_left --%>
    <div id="body_left">
        <%-- menu --%>
        <div id="menu" class="ui vertical pointing menu teal">
            <c:forEach var="item" items="${blogMainPageVo.blogMenuList}">
                <a class="item ${item.active}" href="/MainPage/${item.id}/1">
                        ${item.menu}
                    <div class="ui label ${item.teal}">${item.articleCount}</div>
                </a>
            </c:forEach>
        </div>
        <%-- end menu --%>
    </div>
    <%-- end body_left --%>
    <%-- body_right --%>
    <div id="body_right">
        <%-- article_list --%>
        <div id="article_list" class="ui vertical menu">
            <div class="header item">
                ${blogMainPageVo.currentMenu}
                <span class="ui teal label">点击量</span>
            </div>

            <c:forEach var="item" items="${blogMainPageVo.blogMainPageArticleList}">
                <div class="item">
                    <a href="/ArticlePage/${item.uuid}" target="_blank"><i class="quote left icon"></i>${item.title}</a>

                    <div class="ui label right teal">${item.clickRate}</div>
                </div>
            </c:forEach>
        </div>
        <%-- end article_list --%>
        <%-- pagination --%>
        <div id="pagination" class="ui pagination menu">
            <c:forEach var="item" items="${blogMainPageVo.blogMainPagePaginationList}">
                <a class="item ${item.active}" href="${item.href}">
                        ${item.page}
                </a>
            </c:forEach>
        </div>
        <%-- end pagination --%>
    </div>
    <%-- end body_right --%>
</div>
<%-- end body --%>
<%-- footer --%>
<div id="footer">
    <span>zhang_yao_wu1993@yeah.net</span>
    <span>辽ICP备15003806号</span>
</div>
<%-- end footer --%>
<div class="clearboth"></div>
</body>
</html>
